package ObjectFn4;

import finalStudy.Student;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;

public class test8sort {
    public static void main(String[] args) {
        student[] arr = new student[4];
        arr[0] = new student("tkf",198.55,13);
        arr[1] = new student("tkf2",188.66,14);
        arr[2] = new student("tkf3",189,12);
        arr[3] = new student("tkf4",201,15);
        Arrays.sort(arr,(o1,o2)->staticFn.sortByAge(o1,o2));
        Arrays.sort(arr,staticFn::sortByAgeNotStatic);
        for (int i = 0; i < 4; i++) {
            System.out.println(arr[i].getName()+ "--分割线--"+arr[i].getHeight()+ "--分割线--"+arr[i].getAge());
        }
    }
}
interface intA{
    void getOne();
}

